<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>Rotaract DLSU</title>
        <meta http-equiv="Content-Type" content="text/html"/>
        <meta name="robots" content="index,follow"/>
        <meta name="distribution" content="global"/>
        <meta name="description" content=""/>
        <meta name="keywords" content=""/>
        <link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
        <link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css"/>
        <link rel="stylesheet" href="css/demos.css"/>
        <script src="js/jquery-1.7.2.min.js"></script>
        <script src="js/jquery.ui.core.js"></script>
        <script src="js/jquery.ui.widget.js"></script>
        <script src="js/jquery.ui.datepicker.js"></script>
        <script type="text/javascript" src="javascript/RegistrationValidation.js"></script>

        <script>
            $(function() {
                $( "#datepicker" ).datepicker({
                    changeMonth: true,
                    changeYear: true,
                    dateFormat: 'yy-mm-dd'
                });
            });
        </script>

    </head>
    <body>
        <div id="container2">
            <div id="main2">
                <table width="100%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="main_nav">
                            <div id="main_text2"> 
                                <center>
                                    <h2>Add an Activity</h2>
                                    <br/>
                                    <br/>

                                    <form enctype = "multipart/form-data" name="imageUpload" action="RAC-addActivityUI.php" method="POST" >

                                        <table border ="1" cellpadding="10" class="myTable">
                                            <tr>
                                                <td><b>Title of Activity</b></td>
                                                <td><input type="text" name="actTitle"/><label id="errortitle"></label></td>
                                            </tr>
                                            <tr>
                                                <td><b>Image</b></td>
                                                <td><input type="file" name="imageUpload"/></td>
                                            </tr>    
                                            <tr>
                                                <td><b>Date of Activity</b></td>
                                                <td><input type="text" name="actDate" id="datepicker"/><label id="errordate"></label></td>
                                            </tr>    
                                            <tr>
                                                <td><b>Description</b></td>
                                                <td><input type="text" name="actDesc"/><label id="errordesc"></label></td>
                                            </tr>
                                        </table>
                                        <br/>
                                        <br/>
                                        <input type="submit" name="submit" value="Save" onClick="return validateAddActivity(this.form);" />
                                    </form>
<?php
                                
                                $confirm = '';
                                if (isset($_POST['submit'])){
                                include 'RAC-addActivity.php';
                                
                                if($confirm){
                                    echo "<h4>Addition Successful!</h4>";
                                }
                                else
                                    echo "<h4>Activity already exists!</h4>";
                                }
                                ?>
                                </center>
                            </div>
                        </td>

                    </tr>
                </table>
            </div>
        </div>
    </body>
</html>